[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
fileno() Get File Handle Associated with Stream (Macro)
#include <stdio.h>
int fileno(stream);
FILE *stream; Pointer to file structure
fileno() returns the handle associated with 'stream'. If more than
one handle is associated with 'stream', fileno() returns the handle
assigned when the stream was opened.
Returns: The file handle. There is no error return. If the
stream does not specify an open file, the result is
undefined.
Portability: Not supported by ANSI standard.
-------------------------------- Example ---------------------------------
The following statements open a file and check its length.
#include <stdio.h>
#include <io.h>
FILE *stream;
long length;
main()
{
if ((stream = fopen("work.dat","r+"))!= NULL) {
length = filelength(fileno(stream));
}
}
See Also:
filelength()
fopen()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson